package com.smcaiot.jfttask.south.convert;

import com.smcaiot.jfttask.domain.TaskFlow;
import com.smcaiot.jfttask.south.entity.JftTaskLogs;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author: cz
 * @Date: 2023/10/8
 * @Description:
 */
@Mapper
public interface JftTaskLogsConvert {
    JftTaskLogsConvert INSTANCE = Mappers.getMapper(JftTaskLogsConvert.class);

    @Mapping(target = "taskFlowId", expression = "java(com.smcaiot.jfttask.domain.TaskFlowId.from(taskLogs.getTaskLogId()))")
    @Mapping(target = "taskId", expression = "java(com.smcaiot.jfttask.domain.TaskId.from(taskLogs.getTaskId()))")
    @Mapping(target = "taskBatchId", expression = "java(com.smcaiot.jfttask.domain.TaskBatchId.from(taskLogs.getTaskBatchId()))")
    TaskFlow to(JftTaskLogs taskLogs);
}
